add SetBoundary(boundary string) method#109
Open
vodolaz095 wants to merge 2 commits intogo-gomail:masterfrom
Open
add SetBoundary(boundary string) method#109vodolaz095 wants to merge 2 commits intogo-gomail:masterfrom
vodolaz095 wants to merge 2 commits intogo-gomail:masterfrom
Conversation
|
Please check #108 |
Author
|
and what? you propose to remake pull request to http://github.com/go-mail/mail? |
|
I am just pointing out that any PR's here wont go anywhere atmo, unfortunately see #104. There are a few forks, but the one above seems to have merged some of the outstanding PR's from this repos. |
ivy
reviewed
Feb 14, 2018
writeto.go
Outdated
| func (w *messageWriter) openMultipart(mimeType, boundary string) { | ||
| mw := multipart.NewWriter(w) | ||
| if boundary == "" { | ||
| boundary = mw.Boundary() |
There was a problem hiding this comment.
Correct me if I'm wrong, it doesn't look like there's any need for this assignment unless we decide to use it on L87 in place of mw.Boundary().
Instead, this could be expressed as:
if boundary != "" {
mw.SetBoundary(boundary)
}|
@vodolaz095 Your change looks good to me. I'd definitely like to merge it into go-mail/mail which is actively maintained. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This method is used to manually set mime boundary string. If we don't call this method, the default behaviour is used - aka boundary is generated by https://godoc.org/mime/multipart package.
Also i have added unit tests to ensure it works as expected. And all old unit tests are passing.
Reason i want this method to be present, is because i have to deal with legacy report processing java application, and it hangs sometimes, when i send messages generated by your package.
As far as i understand how this java dinosaur works, it throws errors because boundary generated is 30 bytes long.
https://golang.org/src/mime/multipart/writer.go#L78
And it seems too big for java dinosaur code. Or maybe badly written regex in it... hard to say.
But if i could set boundary manually, you will make my day!
thanks